<template>
	<view class="box">
		<view class="list ">
			<!-- <radio-group @change="radioChange"> -->
				<view class="choose-list f-side " v-for="(item,index) in itemList" :key="index" @tap="getSelect(index,item)">
					<view class="flex list-left flex1" style="width: 100%;">
						<image src="../../static/shop-2019-11-6.png" mode=""></image>
						<view class="text zcOverflow3" >{{item.Name}}丹参多酚酸大方豆腐</view>
						<!-- <view class="currentText text" v-if="index ===current">当前</view> -->
					</view>
<!-- 					<view>
						<view class="iconfont icon-gouxuan111"  :class="index === current?'isCheked icon-gouxuan11':''" ></view>
					</view> -->
				</view>
			<!-- </radio-group> -->
		</view>
								<!-- 无数据 -->
		<view v-if="itemList.length==0" class="uni-tab-bar-loading" style="text-align: center;">
			<view class="no_model">
				<image src="../../static/no_data.png" mode="widthFix" style="width: 100%;"></image>
				<view class="no_text">暂无门店切换！</view>
			</view>
		</view>
	</view>
</template>

<script>
	let _this;
	export default {
		data() {
			return {
				current:-1,
				current2:-1,
				itemList:[
				],
			}
		},
		created(){
			_this = this;
			_this.getSalesManShopOrgan()
		},
		methods: {
			radioChange(e){
				console.log(e);
			},
			getSalesManShopOrgan(){  //获取门店 
				_this.$ZcPublic.Server.Post({
					IsNeedLogin: true,
					Paras: {
						Name: 'Uni_Partner_Detail',
						Action: 'getSalesManShopOrgan',
						Data: {
						}
					},
					Callback:_this.cb_getSalesManShopOrgan,
					Scope: _this
				})
			},
			cb_getSalesManShopOrgan(resJson,scope){
			 if(resJson.state == "back"){
				 	console.log("门店信息",resJson)
					if(resJson.success){
						_this.itemList = resJson.data;
						console.log('_this.itemList',_this.itemList);
					}else{
							uni.showModal({
								title:'温馨提示',
								content: resJson.msg,
								showCancel:false
							})
					}
				}
			},
			doChangeShopOrgan(sn){  //获取门店 
				_this.$ZcPublic.Server.Post({
					IsNeedLogin: true,
					Paras: {
						Name: 'Uni_Partner_Detail',
						Action: 'doChangeShopOrgan',
						Data: {
							SN:sn
						}
					},
					Callback:_this.cb_doChangeShopOrgan,
					Scope: _this
				})
			},
			cb_doChangeShopOrgan(resJson,scope){
			 if(resJson.state == "back"){
				 	console.log("切换门店结果",resJson)
					if(resJson.success){
					uni.showToast({
						title: '切换门店成功'
					});
					setTimeout(function() {
						console.log(999);
					uni.navigateBack();
					}, 1500);
						
					}else{
							uni.showModal({
								title:'温馨提示',
								content: resJson.msg,
								showCancel:false
							})
					}
				}
			},
			getSelect(index,item){
				console.log(index);
				console.log(item);
				_this.current2 = index;
				_this.doChangeShopOrgan(item.SN)
			}
		}
	}
</script>

<style>
image{
	width: 70upx;
	height: 40upx;
	margin: 14upx 30upx 0 20upx;
}
.choose-list{
	height: 110upx;
	line-height: 110upx;
	/* margin-top: 20upx; */
	background-color: #fff;
	padding: 0 20upx;
	border: none !important;
	margin: 20upx ;
	box-shadow: 1upx 1upx 5upx 4upx #EAEDF1;
}

.currentText{
	background-image:linear-gradient(to right, #57B1FF, #68CCF6) ;
	border-radius: 20upx;
	border-bottom-left-radius: 0;
	padding: 0 20upx;
	height: 40upx;
	line-height: 40upx;
	margin-left: 20upx;
	color: #fff;
	position: relative;
	top:12upx !important
	
}
.text{
	position: relative;
	top:11upx
}
.icon-gouxuan11{
	border: none !important;
}
.icon-gouxuan111{
	border: 1upx solid #ccc;
	width: 36upx;
	height: 36upx;
	border-radius: 50%;
	position: relative;
}
.isCheked:before{
	color: #50ADFD;
	font-size: 40upx;
	position: absolute;
	top:-16upx !important
}
</style>
